package com.example.demo.controller;

import com.example.demo.entity.Result;
import com.example.demo.pojo.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
//@RequestMapping("/API/user1")
public class TestController {
    @Autowired
    private UserService userService;
    @Autowired
    private RedisTemplate redisTemplate;
    @GetMapping("test")
    public Result test(){
        List<User> list = userService.list(null);
        return Result.ok(list);
    }
    @GetMapping("test1")
    public Result test1(@RequestParam Map<String,Object> params){
        List<Map<String,Object>> list = userService.getInterId(params);
        return Result.ok(list);
    }
    @GetMapping("test3")
    public Result test3(){
        List<User> list = userService.list(null);
        return Result.ok(list);
    }
    @GetMapping("test4")
    public Result test4(){
        System.out.println("hell world");
        System.out.println("hell world111");
        System.out.println("dev2");
        System.out.println("dev3");
        System.out.println("dev分支");
        System.out.println("Niubi");
        System.out.println("迪迦奥特曼");
        System.out.println("fkaljgljl");
        System.out.println("星空第一");
        System.out.println("dev333");
        return Result.ok("你好");
    }
}
